#pragma once

#include <gofcl_rcu_apb2.h>
#include <gofcl_rcu_r.h>

static inline void rcu_wreg_apb2en_s(rcu_apb2_s apb2) {
	union {
		rcu_apb2_s a;
		u32_s u;
	} au = {
		.a = apb2,
	};
	rcu_wreg_u16(RCU_APB2EN_R, T16B_0_R, au.u);
}

static inline void rcu_wreg_apb2en_0_7_s(rcu_apb2_0_7_s apb2_0_7) {
	union {
		rcu_apb2_0_7_s a;
		u32_s u;
	} au = {
		.a = apb2_0_7,
	};
	rcu_wreg_u8(RCU_APB2EN_R, T8B_0_R, au.u);
}

static inline void rcu_wreg_apb2en_8_15_s(rcu_apb2_8_15_s apb2_8_15) {
	union {
		rcu_apb2_8_15_s a;
		u32_s u;
	} au = {
		.a = apb2_8_15,
	};
	rcu_wreg_u8(RCU_APB2EN_R, T8B_1_R, au.u);
}
